package com.coolbi.onsupai.core.entity;

import java.util.Date;

/**
 * @Description GoodsInfo Entity 商品信息类
 * @author for2cold
 * @codeDate 2012-6-18 下午09:08:57
 * 
 */
public class GoodsInfo extends BaseEntity implements Comparable<GoodsInfo> {

	private static final long serialVersionUID = 1L;

	/** 商品编号 */
	private String goodsNo;
	/** 商品名称 */
	private String goodsName;
	/** 商品单位 */
	private String unitType;
	/** 成本价 */
	private double costPrice;
	/** 批发价 */
	private double wholesalePrice;
	/** 出售价 */
	private double unitPrice;
	/** 最近售价 */
	private double recentPrice;
	/** 规格 */
	private String specification;
	/** 商品图片URL */
	private String pictureUrl;
	/** 库存量 */
	private Long stock;
	/** 可订购量 */
	private Long enableStock;
	/** 销售状态 */
	private Integer saleStatus;
	/** 是否为赠品 */
	private Boolean isGift;
	/** 过期日期 */
	private Date expireDate;
	/** 商品类别ID */
	private Long goodsCategoryId;
	/** 商品类别 */
	private GoodsCategory goodsCategory;
	/** 抵押积分 */
	private Integer creditNum;
	/** 供应商ID */
	private Long merchantId;
	/** 供应商对象 */
	private Merchant merchant;

	/** 商品名称 */
	public String getGoodsName() {
		return goodsName;
	}

	/** 商品名称 */
	public void setGoodsName(String goodsName) {
		this.goodsName = goodsName;
	}

	/** 商品单位 */
	public String getUnitType() {
		return unitType;
	}

	/** 商品单位 */
	public void setUnitType(String unitType) {
		this.unitType = unitType;
	}

	/** 单价 */
	public double getUnitPrice() {
		return unitPrice;
	}

	/** 单价 */
	public void setUnitPrice(double unitPrice) {
		this.unitPrice = unitPrice;
	}

	/** 规格 */
	public String getSpecification() {
		return specification;
	}

	/** 规格 */
	public void setSpecification(String specification) {
		this.specification = specification;
	}

	/** 商品编号 */
	public String getGoodsNo() {
		return goodsNo;
	}

	/** 商品编号 */
	public void setGoodsNo(String goodsNo) {
		this.goodsNo = goodsNo;
	}

	/** 过期日期 */
	public Date getExpireDate() {
		return expireDate;
	}

	/** 过期日期 */
	public void setExpireDate(Date expireDate) {
		this.expireDate = expireDate;
	}

	/** 是否为赠品 */
	public Boolean getIsGift() {
		return isGift;
	}

	/** 是否为赠品 */
	public void setIsGift(Boolean isGift) {
		this.isGift = isGift;
	}

	/** 库存量 */
	public Long getStock() {
		return stock;
	}

	/** 库存量 */
	public void setStock(Long stock) {
		this.stock = stock;
	}

	/** 可订购量 */
	public Long getEnableStock() {
		return enableStock;
	}

	/** 可订购量 */
	public void setEnableStock(Long enableStock) {
		this.enableStock = enableStock;
	}

	/** 销售状态 */
	public Integer getSaleStatus() {
		return saleStatus;
	}

	/** 销售状态 */
	public void setSaleStatus(Integer saleStatus) {
		this.saleStatus = saleStatus;
	}

	/** 商品类别ID */
	public Long getGoodsCategoryId() {
		return goodsCategoryId;
	}

	/** 商品类别ID */
	public void setGoodsCategoryId(Long goodsCategoryId) {
		this.goodsCategoryId = goodsCategoryId;
	}

	/** 商品类别 */
	public GoodsCategory getGoodsCategory() {
		return goodsCategory;
	}

	/** 商品类别 */
	public void setGoodsCategory(GoodsCategory goodsCategory) {
		this.goodsCategory = goodsCategory;
	}

	/** 抵押积分 */
	public Integer getCreditNum() {
		return creditNum;
	}

	/** 抵押积分 */
	public void setCreditNum(Integer creditNum) {
		this.creditNum = creditNum;
	}

	/** 最近售价 */
	public double getRecentPrice() {
		return recentPrice;
	}

	/** 最近售价 */
	public void setRecentPrice(double recentPrice) {
		this.recentPrice = recentPrice;
	}

	/** 供应商ID */
	public Long getMerchantId() {
		return merchantId;
	}

	/** 供应商ID */
	public void setMerchantId(Long merchantId) {
		this.merchantId = merchantId;
	}

	/** 供应商对象 */
	public Merchant getMerchant() {
		return merchant;
	}

	/** 供应商对象 */
	public void setMerchant(Merchant merchant) {
		this.merchant = merchant;
	}

	/** 成本价 */
	public double getCostPrice() {
		return costPrice;
	}

	/** 成本价 */
	public void setCostPrice(double costPrice) {
		this.costPrice = costPrice;
	}

	/** 批发价 */
	public double getWholesalePrice() {
		return wholesalePrice;
	}

	/** 批发价 */
	public void setWholesalePrice(double wholesalePrice) {
		this.wholesalePrice = wholesalePrice;
	}

	/** 商品图片URL */
	public String getPictureUrl() {
		return pictureUrl;
	}

	/** 商品图片URL */
	public void setPictureUrl(String pictureUrl) {
		this.pictureUrl = pictureUrl;
	}

	@Override
	public int compareTo(GoodsInfo o) {
		long result = this.getMerchantId() - o.getMerchantId();
		if (result == 0) {
			return 0;
		}
		return result > 0 ? 1 : -1;
	}

}
